<?php 

	//--声明数组的表结构--
	$a = array("a", 10, "b", 10);
	$b = array(1,   4,  2,   3 );

	array_multisort($a, SORT_DESC, $b, SORT_DESC);

	print_r($a);
	echo "<br>";
	print_r($b);

	//多位数组的按照条件排序
	$data = array(
			array('id' => 1, 'name'=> 'aa', 'age'=> 10),
			array('id' => 2, 'name'=> 'ww', 'age'=> 20),
			array('id' => 3, 'name'=> 'cc', 'age'=> 30),
			array('id' => 4, 'name'=> 'dd', 'age'=> '40')
		);

	$ages = array();
	$names = array();

	foreach ($data as $value) {
		$ages[] = $value['age'];
		$names[] = $value['name'];
	}

	array_multisort($ages, SORT_DESC, $names, $data);

	echo "<pre>";
	print_r($data);
	echo "</pre>";





 ?>